//
//  PersonalDataHeaderView.m
//  安好
//
//  Created by 马晓良 on 14-11-5.
//  Copyright (c) 2014年 lianchuangbrother. All rights reserved.
//

#import "PersonalDataHeaderView.h"

@implementation PersonalDataHeaderView

/**
 * 用户的头像
 */
- (UIImageView *)headerImageView{
    if (nil == _headerImageView) {
        if (kScreenWidth == 414) {
            _headerImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.frame.size.width / 2 - 36, 10, 72, 72)];
        }else{
            _headerImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.frame.size.width / 2 - 30, 10, 60, 60)];
        }
        _headerImageView.image = [UIImage imageNamed:@"圆形头像"];
        _headerImageView.userInteractionEnabled = YES;
        [self addSubview:_headerImageView];
        [self addSubview:self.maskImageView];
    }
    return _headerImageView;
}

- (UIImageView *)maskImageView{
    if (nil == _maskImageView) {
        if (kScreenWidth == 414) {
            _maskImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.frame.size.width / 2 - 36, 10, 72, 72)];
        }else{
            _maskImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.frame.size.width / 2 - 30, 10, 60, 60)];
        }
        _maskImageView.image = [UIImage imageNamed:@"我的头像框_1"];
    }
    return _maskImageView;
}

/**
 * 用户名
 */
- (UILabel *)nameLabel{
    if (nil == _nameLabel) {
        if (kScreenWidth == 414) {
            _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth / 2 - 75, 92, 150, 18)];
            _nameLabel.font = [UIFont systemFontOfSize:TITLE_TEXTLABEL_FOUNT_SIZE];
        }else{
            _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth / 2 - 75, 80, 150, 18)];
            _nameLabel.font = [UIFont systemFontOfSize:TITLE_TEXTLABEL_FOUNT_SIZE];
        }
        _nameLabel.textAlignment = NSTextAlignmentCenter;
        _nameLabel.textColor = [UIColor whiteColor];
        [self addSubview:_nameLabel];
    }
    return _nameLabel;
}

/**
 * 话题信息
 */
- (TopicAndIntegralView *)topicView{
    if (nil == _topicView) {
        if (kScreenWidth == 414) {
            _topicView = [[TopicAndIntegralView alloc] initWithFrame:CGRectMake(kScreenWidth / 2 - 60, 117, 80, 12)];
        }else{
            _topicView = [[TopicAndIntegralView alloc] initWithFrame:CGRectMake(kScreenWidth / 2 - 60, 105, 80, 12)];
        }
        _topicView.typeName.text = @"话题";
        [self addSubview:_topicView];
    }
    return _topicView;
}

/**
 * 积分信息
 */
- (TopicAndIntegralView *)integralView{
    if (nil == _integralView) {
        if (kScreenWidth == 414) {
            _integralView = [[TopicAndIntegralView alloc] initWithFrame:CGRectMake(kScreenWidth / 2 + 20, 117, 80, 12)];
        }else{
            _integralView = [[TopicAndIntegralView alloc] initWithFrame:CGRectMake(kScreenWidth / 2 + 20, 105, 80, 12)];
        }
        _integralView.typeName.text = @"积分";
        [self addSubview:_integralView];
    }
    return _integralView;
}
/**
 * 横向线条
 */
- (UIImageView *)lineImageView{
    if (nil == _lineImageView) {
        if (kScreenWidth == 414) {
            _lineImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 137, kScreenWidth, 1)];
        }else{
            _lineImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 125, kScreenWidth, 1)];
        }
        [self addSubview:_lineImageView];
    }
    return _lineImageView;
}
/**
 * 个性签名
 */
- (UILabel *)contentLabel{
    if (nil == _contentLabel) {
        if (kScreenWidth == 414) {
            _contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 138, kScreenWidth - 10, 35)];
            _contentLabel.font = [UIFont systemFontOfSize:14];
        }else{
            _contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 126, kScreenWidth - 10, 26)];
            _contentLabel.font = [UIFont systemFontOfSize:12];
        }
        _contentLabel.textColor = [UIColor whiteColor];
        _contentLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:_contentLabel];
    }
    return _contentLabel;
}
/**
 * 竖向线条
 */
- (UIImageView *)smallImageView{
    if (nil == _smallImageView) {
        if (kScreenWidth == 414) {
            _smallImageView = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth / 2 - 1, 117, 1, 12)];
        }else{
            _smallImageView = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth / 2 - 1, 105, 1, 12)];
        }
        [self addSubview:_smallImageView];
    }
    return _smallImageView;
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
